#include <iostream>
using namespace std;
#pragma warning(disable : 4996)
#include "trainer.h"

Trainer::Trainer(const char* n) : name(NULL)/*, theProgram()*/
{
	setName(n);
}


Trainer::~Trainer()
{
	delete []name;
}

void Trainer::setName(const char* name)
{
	delete []this->name;
	this->name = new char[strlen(name)+1];
	strcpy(this->name, name);
}

//void Trainer::show() const
//{
//	cout << "Name: " << name << endl;
//}

void Trainer::addExercise(const Exercise& newExercise)
{
	//theProgram.addExercise(newExercise);
	theProgram += newExercise; //#WD[2] RonnyR 10.12
}

bool Trainer::equals(const Trainer& other) const
{
	return strcmp(name, other.name) == 0 ? true : false;
}


ostream & operator<<(ostream & os,const Trainer &T) //#WD[2] RonnyR 3.12
{
	
os << "Name: " << T.getName() << endl;
	
return os;	
}

